From 4c22f26b6155c1d7918bcc37d2002fdc4128e443 Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Wed, 15 Jun 2005 23:26:50 +0000 Subject: [PATCH] bitkeeper revision 1.1709.1.11 (42b0b93aUkhSewPtS6RpEdWHg0T5Mw) More hyperprivops Signed-off-by: Dan Magenheimer --- xen/arch/ia64/privop.c | 32 ++++++++++++++++++++++++++++++-- xen/arch/ia64/vcpu.c | 13 +++++++++---- xen/include/asm-ia64/vcpu.h | 4 ++-- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/xen/arch/ia64/privop.c b/xen/arch/ia64/privop.c index 99f57a13a1..c4fbcca45c 100644 --- a/xen/arch/ia64/privop.c +++ b/xen/arch/ia64/privop.c @@ -753,11 +753,17 @@ priv_emulate(VCPU *vcpu, REGS *regs, UINT64 isr) #define HYPERPRIVOP_SET_TPR 0xa #define HYPERPRIVOP_EOI 0xb #define HYPERPRIVOP_SET_ITM 0xc -#define HYPERPRIVOP_MAX 0xc +#define HYPERPRIVOP_THASH 0xd +#define HYPERPRIVOP_PTC_GA 0xe +#define HYPERPRIVOP_ITR_D 0xf +#define HYPERPRIVOP_GET_RR 0x10 +#define HYPERPRIVOP_SET_RR 0x11 +#define HYPERPRIVOP_MAX 0x11 char *hyperpriv_str[HYPERPRIVOP_MAX+1] = { 0, "rfi", "rsm.dt", "ssm.dt", "cover", "itc.d", "itc.i", "ssm.i", - "=ivr", "=tpr", "tpr=", "eoi", "itm=", + "=ivr", "=tpr", "tpr=", "eoi", "itm=", "thash", "ptc.ga", "itr.d", + "=rr", "rr=", 0 }; @@ -772,6 +778,7 @@ ia64_hyperprivop(unsigned long iim, REGS *regs) struct vcpu *v = (struct domain *) current; INST64 inst; UINT64 val; + UINT64 itir, ifa; // FIXME: Handle faults appropriately for these if (!iim || iim > HYPERPRIVOP_MAX) { @@ -820,6 +827,27 @@ ia64_hyperprivop(unsigned long iim, REGS *regs) case HYPERPRIVOP_SET_ITM: (void)vcpu_set_itm(v,regs->r8); return 1; + case HYPERPRIVOP_THASH: + (void)vcpu_thash(v,regs->r8,&val); + regs->r8 = val; + return 1; + case HYPERPRIVOP_PTC_GA: + // FIXME: this doesn't seem to work yet, turned off + //(void)vcpu_ptc_ga(v,regs->r8,regs->r9); + //return 1; + break; + case HYPERPRIVOP_ITR_D: + (void)vcpu_get_itir(v,&itir); + (void)vcpu_get_ifa(v,&ifa); + (void)vcpu_itr_d(v,regs->r8,regs->r9,itir,ifa); + return 1; + case HYPERPRIVOP_GET_RR: + (void)vcpu_get_rr(v,regs->r8,&val); + regs->r8 = val; + return 1; + case HYPERPRIVOP_SET_RR: + (void)vcpu_set_rr(v,regs->r8,regs->r9); + return 1; } return 0; } diff --git a/xen/arch/ia64/vcpu.c b/xen/arch/ia64/vcpu.c index 2643ffc30f..45ae1bc656 100644 --- a/xen/arch/ia64/vcpu.c +++ b/xen/arch/ia64/vcpu.c @@ -43,8 +43,9 @@ typedef union { #ifdef PRIVOP_ADDR_COUNT struct privop_addr_count privop_addr_counter[PRIVOP_COUNT_NINSTS] = { - { "rsm", { 0 }, { 0 }, 0 }, - { "ssm", { 0 }, { 0 }, 0 } + { "=ifa", { 0 }, { 0 }, 0 }, + { "thash", { 0 }, { 0 }, 0 }, + 0 }; extern void privop_count_addr(unsigned long addr, int inst); #define PRIVOP_COUNT_ADDR(regs,inst) privop_count_addr(regs->cr_iip,inst) @@ -135,7 +136,7 @@ IA64FAULT vcpu_reset_psr_sm(VCPU *vcpu, UINT64 imm24) struct ia64_psr psr, imm, *ipsr; REGS *regs = vcpu_regs(vcpu); - PRIVOP_COUNT_ADDR(regs,_RSM); + //PRIVOP_COUNT_ADDR(regs,_RSM); // TODO: All of these bits need to be virtualized // TODO: Only allowed for current vcpu __asm__ __volatile ("mov %0=psr;;" : "=r"(psr) :: "memory"); @@ -183,7 +184,7 @@ IA64FAULT vcpu_set_psr_sm(VCPU *vcpu, UINT64 imm24) REGS *regs = vcpu_regs(vcpu); UINT64 mask, enabling_interrupts = 0; - PRIVOP_COUNT_ADDR(regs,_SSM); + //PRIVOP_COUNT_ADDR(regs,_SSM); // TODO: All of these bits need to be virtualized __asm__ __volatile ("mov %0=psr;;" : "=r"(psr) :: "memory"); imm = *(struct ia64_psr *)&imm24; @@ -369,6 +370,8 @@ IA64FAULT vcpu_get_iip(VCPU *vcpu, UINT64 *pval) IA64FAULT vcpu_get_ifa(VCPU *vcpu, UINT64 *pval) { UINT64 val = PSCB(vcpu,ifa); + REGS *regs = vcpu_regs(vcpu); + PRIVOP_COUNT_ADDR(regs,_GET_IFA); *pval = val; return (IA64_NO_FAULT); } @@ -422,6 +425,8 @@ IA64FAULT vcpu_get_iha(VCPU *vcpu, UINT64 *pval) { //return vcpu_thash(vcpu,PSCB(vcpu,ifa),pval); UINT64 val = PSCB(vcpu,iha); + REGS *regs = vcpu_regs(vcpu); + PRIVOP_COUNT_ADDR(regs,_THASH); *pval = val; return (IA64_NO_FAULT); } diff --git a/xen/include/asm-ia64/vcpu.h b/xen/include/asm-ia64/vcpu.h index d3ef4c229b..f4ca7de36f 100644 --- a/xen/include/asm-ia64/vcpu.h +++ b/xen/include/asm-ia64/vcpu.h @@ -23,8 +23,8 @@ typedef struct pt_regs REGS; #define PRIVOP_ADDR_COUNT #ifdef PRIVOP_ADDR_COUNT -#define _RSM 0 -#define _SSM 1 +#define _GET_IFA 0 +#define _THASH 1 #define PRIVOP_COUNT_NINSTS 2 #define PRIVOP_COUNT_NADDRS 30 -- 2.30.2